home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / infoplus.zip / PAGE_09.INC < prev    next >
Text File  |  1990-06-25  |  10KB  |  415 lines

  1. procedure page_09;
  2.  
  3. const
  4.   filesmax = 255;
  5.   weekday: array[0..6] of string[9] = ('Sunday', 'Monday', 'Tuesday',
  6.       'Wednesday', 'Thursday', 'Friday', 'Saturday');
  7.  
  8. var
  9.   f : array[1..filesmax] of file;
  10.   i : 0..filesmax;
  11.   j : 1..filesmax;
  12.   xbool : boolean;
  13.   xbyte : byte;
  14.   xchar : char;
  15.   xstring1 : string;
  16.   xstring2 : string;
  17.   xword1 : word;
  18.   xword2 : word;
  19.   xword3 : word;
  20.   xword4 : word;
  21.   xword5 : word;
  22.  
  23.   procedure showecho(a : word);
  24.     var
  25.       xbyte : byte;
  26.  
  27.     begin
  28.     xbyte:=mem[DOScseg : a];
  29.     case xbyte of
  30.       $00 : writeln('off');
  31.       $FF : writeln('on')
  32.     else
  33.       unknown('status', xbyte, 2)
  34.     end
  35.     end; {showecho}
  36.  
  37.   procedure showbufs(a : word);
  38.     const
  39.       bufsmax = 99;
  40.  
  41.     var
  42.       i : 0..bufsmax + 1;
  43.       xbool : boolean;
  44.       xword1 : word;
  45.       xword2 : word;
  46.       xword3 : word;
  47.  
  48.     begin
  49.     if osmajor < 4 then
  50.       begin
  51.       i:=0;
  52.       xword1:=memw[DOScseg : a];
  53.       xword2:=memw[DOScseg : a + 2];
  54.       xbool:=false;
  55.       repeat
  56.         if i <= bufsmax then
  57.           begin
  58.           if xword1 < $FFFF then
  59.             begin
  60.             inc(i);
  61.             xword3:=xword1;
  62.             xword1:=memw[xword2 : xword3];
  63.             xword2:=memw[xword2 : xword3 + 2]
  64.             end
  65.           else
  66.             begin
  67.             xbool:=true;
  68.             writeln(i)
  69.             end
  70.           end
  71.         else
  72.           begin
  73.           xbool:=true;
  74.           dontknow
  75.           end
  76.       until xbool
  77.       end
  78.     else
  79.       with regs do
  80.         begin
  81.         AX:=$5200;
  82.         MsDos(regs);
  83.         Write(MemW[ES:BX + $3F]:5);
  84.         caption3('Read-ahead');
  85.         Writeln(MemW[ES:BX + $41])
  86.         end
  87.     end; {showbufs}
  88.     (*  BIX ms.dos/secrets #2  *)
  89.  
  90.   begin (* procedure page_09 *)
  91.   window(1, 3, twidth div 2, tlength - 2);
  92.   caption2('DOS version');
  93.   showvers;
  94.   caption2('OEM serial number');
  95.   with regs do
  96.     begin
  97.     AX:=$3000;
  98.     BX:=0;
  99.     MsDos(regs);
  100.     Writeln(hex(BH, 2))
  101.     end;
  102.   caption2('System date');
  103.   getdate(xword1, xword2, xword3, xword4);
  104.   if xword4 < 7 then
  105.     Write(weekday[xword4])
  106.   else
  107.     write('(', hex(xword4, 4), ')');
  108.   write(', ');
  109.   xword5:=cbw(country[0], country[1]);
  110.   xchar:=chr(country[11]);
  111.   case xword5 of
  112.     $0001: writeln(xword3, xchar, xword2, xchar, xword1);
  113.     $0002: writeln(xword1, xchar, xword2, xchar, xword3)
  114.   else
  115.     writeln(xword2, xchar, xword3, xchar, xword1)
  116.   end;
  117.   caption2('System time');
  118.   gettime(xword1, xword2, xword3, xword4);
  119.   if country[17] and 1 = 0 then
  120.     case xword1 of
  121.       0: Write('12');
  122.       1..12: zeropad(xword1);
  123.       13..23: Write(xword1 - 12)
  124.     end
  125.   else
  126.     zeropad(xword1);
  127.   write(chr(country[13]));
  128.   zeropad(xword2);
  129.   write(chr(country[13]));
  130.   zeropad(xword3);
  131.   write(chr(country[9]));
  132.   zeropad(xword4);
  133.   if country[17] and 1 = 0 then
  134.     if xword1 > 11 then
  135.       Write(' pm')
  136.     else
  137.       Write(' am');
  138.   writeln;
  139.   caption2('Command load paragraph');
  140.   writeln(hex(prefixseg, 4));
  141.   getcbreak(xbool);
  142.   offoron('Ctrl-C check', xbool);
  143.   getverify(xbool);
  144.   offoron('Disk verify', xbool);
  145.   caption2('Switch prefix character');
  146.   writeln(switchar);
  147.   caption2('\DEV\ prefix for devices');
  148.   with regs do begin
  149.     AX:=$3702;
  150.     MSDOS(regs);
  151.     if DL = $00 then
  152.       writeln('required')
  153.     else
  154.       writeln('optional')
  155.   end;
  156.   caption2('Reset boot');
  157.   xword1:=memw[BIOSdseg : $72];
  158.   case xword1 of
  159.     $0000: Writeln('cold');
  160.     $1234, $1200, $EDCB: Writeln('bypass memory test');
  161.     $4321: Writeln('preserve memory');
  162.     $5678: Writeln('system suspended');
  163.     $9ABC{-25924}: Writeln('manufacturing test mode'); (*!$9ABC*)
  164.     $ABCD{-21555}: Writeln('system POST loop mode') (*!$ABCD*)
  165.   else
  166.     unknown('flag', xword1, 4)
  167.   end;
  168.   caption2('Boot disk was');
  169.   if osmajor >=4 then
  170.     with regs do
  171.       begin
  172.       AX:=$3305;
  173.       MsDos(regs);
  174.       Writeln(Chr(DL+$40), ':')
  175.       end
  176.   else
  177.     dontknow;
  178. (*  Byte 12:12 p.178  *)
  179.   with regs do begin
  180.     caption2('DOS critical flag');
  181.     AX:=$5D06;
  182.     MSDOS(regs);
  183.     segofs(DS, SI);
  184.     writeln
  185.   end;
  186.   caption2('DOS busy flag    ');
  187.   segofs(DOScseg, DOScofs);
  188.   writeln;
  189.   caption2('Printer echo');
  190.   case osmajor of
  191.     3 : case osminor div 10 of
  192.       0 : dontknow;
  193.       1..3 : showecho($02AC)
  194.       else
  195.         dontknow
  196.     end;
  197.       4 : showecho($02FE);
  198.   else
  199.       dontknow
  200.   end;
  201. (*  BIX ms.dos/secrets #501  *)
  202.   caption2('PrtSc status');
  203.   xbyte:=mem[BIOSdseg : $0100];
  204.   case xbyte of
  205.     $00 : writeln('ready');
  206.     $01 : writeln('busy');
  207.     $FF : writeln('error on last PrtSc')
  208.     else
  209.       unknown('status', xbyte, 2)
  210.   end;
  211.   caption2('Memory allocation');
  212.   with regs do begin
  213.     AX:=$5800;
  214.     MSDOS(regs);
  215.     case AL of
  216.       0: Writeln('first fit');
  217.       1: Writeln('best fit');
  218.       2: Writeln('last fit')
  219.     else
  220.       dontknow
  221.     end
  222.   end;
  223.   caption2('DOS buffers');
  224.   case osmajor of
  225.     3 : case osminor div 10 of
  226.           0 : showbufs($013F);
  227.           1..3 : showbufs($0038)
  228.         else
  229.           dontknow
  230.         end;
  231.     4 : showbufs(0)
  232.   else
  233.     dontknow
  234.   end;
  235.   if (osmajor >= 4) or ((osmajor = 3) and (osminor >= 30)) then
  236.     with regs do
  237.       begin
  238.       BX:=filesmax;
  239.       AH:=$67;
  240.       MSDos(regs)
  241.       end;
  242.   caption2('File handle table ');
  243.   xword1:=memw[prefixseg : $0036];
  244.   xword2:=memw[prefixseg : $0034];
  245.   segofs(xword1, xword2);
  246.   Writeln;
  247.   caption2('  length');
  248.   write(memW[prefixseg : $0032] : 3);
  249.   caption2('  used');
  250.   i:=0;
  251.   while mem[xword1 : xword2] < $FF do begin
  252.     inc(i);
  253.     inc(xword2)
  254.   end;
  255.   write(i : 3);
  256.   caption1('  free');
  257.   i:=0;
  258.   xbool:=false;
  259.   FileMode:=0;
  260.   xstring1:=ParamStr(0);
  261.   repeat
  262.     if i < filesmax then begin
  263.       assign(f[i + 1], xstring1);
  264.       reset(f[i + 1]);
  265.       if IOResult = 0 then
  266.         inc(i)
  267.       else begin
  268.         xbool:=true;
  269.         caption2('');
  270.         writeln(i:3)
  271.       end
  272.     end else begin
  273.       xbool:=true;
  274.       caption2('');
  275.       dontknow
  276.     end
  277.   until xbool;
  278.   for j:=1 to i do
  279.     close(f[j]);
  280.   FileMode:=2;
  281.   with regs do
  282.     begin
  283.     AH:=$52;
  284.     MsDos(regs);
  285.     caption2('File Control Blocks');
  286.     Writeln;
  287.     caption3('amount');
  288.     if (osmajor = 4) or ((osmajor = 3) and (osminor > 0)) then
  289.       begin
  290.       xword3:=MemW[ES:BX + $1E];
  291.       xword2:=MemW[ES:BX + $1A];
  292.       xword1:=MemW[ES:BX + $1C]
  293.       end
  294.     else
  295.       begin
  296.       xword3:=MemW[ES:BX + $26];
  297.       xword2:=MemW[ES:BX + $22];
  298.       xword1:=MemW[ES:BX + $24]
  299.       end;
  300.     Write(MemW[xword1:xword2 + 4]:3);
  301.     caption3('protected');
  302.     Write(xword3:3)
  303.     end;
  304.   window(1 + twidth div 2, 3, twidth, tlength - 2);
  305.   caption2('Stacks');
  306.   if osmajor = 3 then
  307.     dontknow
  308.   else
  309.     with regs do
  310.     begin
  311.     AH:=$52;
  312.     MsDos(regs);
  313.     xword1:=MemW[ES:BX - 2];
  314.     xword4:=0; {# of stacks}
  315.     xword5:=0; {size of stacks}
  316.     if (Mem[xword1:0] <> $4D) or (MemW[xword1:1] <> 8) then
  317.       dontknow
  318.     else
  319.       begin
  320.       xword2:=$10;
  321.       xbool:=false;
  322.       repeat
  323.         xchar:=Chr(Mem[xword1:xword2]);
  324.         if xchar = 'S' then
  325.           begin
  326.           xword3:=MemW[xword1:xword2 + 1];
  327.           xword4:=Mem[xword3:2];
  328.           xword5:=Mem[xword3:6]
  329.           end;
  330.         if (xchar = 'M') or (xchar = 'Z') then
  331.           xbool:=true;
  332.         xword2:=xword2 + (MemW[xword1:xword2 + 3] * $10) + $10;
  333.       until xbool;
  334.       Writeln;
  335.       caption3('amount');
  336.       Write(xword4:3);
  337.       caption3('size each (bytes)');
  338.       Writeln(xword5:3);
  339.       end
  340.   end;
  341.   Writeln;
  342.   TextColor(LightCyan);
  343.   Write('------ International Information -----');
  344.   Writeln;
  345.   caption2('Global code page');
  346.   with regs do begin
  347.     AX:=$6601;
  348.     MSDOS(regs);
  349.     if AL = $01 then begin
  350.       writeln;
  351.       caption3('Active ');
  352.       writeln(BX : 5);
  353.       caption3('Default');
  354.       writeln(DX : 5)
  355.     end else
  356.       writeln('N/A')
  357.   end;
  358.   caption2('Country code');
  359.   writeln(ccode);
  360.   caption2('Thousands separator character');
  361.   writeln(chr(country[7]));
  362.   caption2('Decimal separator character');
  363.   writeln(chr(country[9]));
  364.   caption2('Data-list separator character');
  365.   writeln(chr(country[22]));
  366.   caption2('Date format');
  367.   xword1:=cbw(country[0], country[1]);
  368.   xchar:=chr(country[11]);
  369.   case xword1 of
  370.     0: writeln('USA (mm', xchar, 'dd', xchar, 'yy)');
  371.     1: writeln('Europe (dd', xchar, 'mm', xchar, 'yy)');
  372.     2: writeln('Japan (yy', xchar, 'mm', xchar, 'dd)')
  373.   else
  374.     unknown('format', xword1, 4)
  375.   end;
  376.   caption3('Separator character');
  377.   writeln(xchar);
  378.   caption2('Time format');
  379.   if (country[17] and $01) = $00 then
  380.     write('12')
  381.   else
  382.     write('24');
  383.   writeln('-hour');
  384.   caption3('Separator character');
  385.   writeln(chr(country[13]));
  386.   caption2('Currency format');
  387.   xstring1:='xxxx';
  388.   insert(chr(country[7]), xstring1, 2);
  389.   xstring1:=xstring1 + chr(country[9]);
  390.   for i:=1 to country[16] do
  391.     xstring1:=xstring1 + 'y';
  392.   xstring2:='';
  393.   i:=2;
  394.   xchar:=chr(country[i]);
  395.   while (i <= 6) and (xchar > #0) do begin
  396.     xstring2:=xstring2 + xchar;
  397.     inc(i);
  398.     xchar:=chr(country[i])
  399.   end;
  400.   case country[15] and $03 of
  401.     $00 : xstring1:=xstring2 + xstring1;
  402.     $01 : xstring1:=xstring1 + xstring2;
  403.     $02 : xstring1:=xstring2 + ' ' + xstring1;
  404.     $03 : xstring1:=xstring1 + ' ' + xstring2;
  405.     $04 : begin
  406.       delete(xstring1, 6, 1);
  407.       insert(xstring2, xstring1, 6)
  408.     end
  409.   end;
  410.   writeln(xstring1);
  411.   caption2('Case map call address');
  412.   segofs(cbw(country[20], country[21]), cbw(country[18], country[19]));
  413.   writeln
  414. end;
  415.